package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrdersMapper {
    //添加订单数据
    @Insert("insert into orders values (#{id},#{number},#{status},#{userId},#{addressBookId},#{orderTime},#{checkoutTime}," +
            "#{payMethod},#{amount},#{remark},#{phone},#{address},#{userName},#{consignee})")
    Integer save(Orders orders);
    //查询订单列表
    @Select("select * from orders where user_id = #{uid} order by order_time desc")
    List<Orders> findOrdersById(Long uid);
}
